


/*
 * XAPI.cpp
 * 
 * Copyright 2015 Alexander Good <goodxander@yahoo.com>
 * 
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301, USA.
 */

/**
 * 2015-03-05  Alexander Good  <goodxander@yahoo.com>
 * 		1.0 First stable copy
 * 		@brief This is but a platform ready for modification and growth,
 * 			to provide a way to make C/C++ more user friendly and less 
 * 			of a mid-level language.  Although this shouln't end up like
 * 			an implemetation of basic  (It would be a nice package 
 * 			though).
 * 
 * @link http:\\sites.google.com\site\XandersAPIC\
*/





#include <stdio.h>
#ifndef XAPI
#define XAPI 1

typedef void * var;
typedef char * cstring;
#ifdef __LCC__
#define __XCALL __STDCALL
#else
#define __XCALL declspec( dllexport )
#endif

#define Var(a) ((var)a)

static var api_dat; /* All data alloc with valloc*/
static int stackc;

inline int 		vtoi(var a){return (int)   a;};
//inline float 	vtof(var a){return (float) a;};
inline var		vollac(int size){ stackc+=size;return &api_dat+stackc-1;};
#endif

/* Test by Alexander Good*/
int main(){
	printf("The current \" Weight of the stack\" is %i\n",stackc);
	printf("Adding var \" Test\" to the stack\n");
	var test = vollac(sizeof("Hello"));
	printf("Added to stack\n");
	test = Var("Hello");
	printf("set test's value to %s\n",test);
	printf("Weight of test is %i\n",sizeof(test));
	printf("Weight is now %i\n",stackc);
	return 0;
}
